<template>
  <div class="head">
    <div class="tit" @click="tab">
      <button id="1" :class="id==='1'?'active':''" class="tex1">业务员账单报表</button>
      <button id="2" :class="id==='2'?'active':''" class="tex1">网点派费直达报表</button>
    </div>
    <div class="line" />
    <el-row>
      <el-col :span="24">
        <div v-if="id==='1'" class="title1">
          <el-form ref="form" style="display: flex;flex-wrap: wrap;margin-top: 24px;justify-content: space-between;" :model="form" label-width="80px">
            <el-form-item style="margin-left: 0;" class="text" label="日期">
              <el-date-picker
                v-model="value"
                type="daterange"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :default-time="['00:00:00', '23:59:59']"
                style="width: 708px"
              />
            </el-form-item>
            <el-form-item class="text" label="网点名称">
              <el-select
                placeholder="请选择"
                style="width: 286px;"
              >
                <el-option
                  v-for="item in cityList"
                  :key="item.id"
                  class="input"
                  :label="item.city"
                  :value="item.city"
                />
              </el-select>
            </el-form-item>
            <el-form-item class="text" label="承包区名">
              <el-select
                placeholder="请选择"
                style="width: 286px;"
              >
                <el-option
                  v-for="item in cityList"
                  :key="item.id"
                  class="input"
                  :label="item.city"
                  :value="item.city"
                />
              </el-select>
            </el-form-item>
            <div>
              <el-form-item>
                <el-button type="primary" @click="onSubmit">查询</el-button>
                <el-button>重置</el-button>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div v-if="id==='1'" class="title1">
          <el-form ref="form" style="display: flex;justify-content: space-between;flex-wrap: wrap;" :model="form" label-width="80px">
            <!-- <div style="display: flex;justify-content: space-around;flex-wrap: wrap;"> -->
            <el-form-item class="text" label="业务员名">
              <el-select
                class="input"
                placeholder="请输入关键字后自动搜索"
                style="width: 286px;"
                @change="provinceChange"
              >
                <el-option
                  v-for="item in ProvinceList"
                  :key="item.id"
                  :label="item.province"
                  :value="{ pid: item.pid, province: item.province }"
                />
              </el-select>
            </el-form-item>
            <el-form-item class="text" label="汇总维度">
              <el-select
                class="input"
                placeholder="请输入关键字后自动搜索"
                style="width: 286px;"
                @change="provinceChange"
              >
                <el-option
                  v-for="item in ProvinceList"
                  :key="item.id"
                  :label="item.province"
                  :value="{ pid: item.pid, province: item.province }"
                />
              </el-select>
            </el-form-item>
            <el-form-item class="text" label="费用类型">
              <el-select
                class="input"
                placeholder="请输入关键字后自动搜索"
                style="width: 286px;"
                @change="provinceChange"
              >
                <el-option
                  v-for="item in ProvinceList"
                  :key="item.id"
                  :label="item.province"
                  :value="{ pid: item.pid, province: item.province }"
                />
              </el-select>
            </el-form-item>
            <div
              style="font-size: 18px;
              font-family: Source Han Sans CN;
              font-weight: 400;
              color: #EE3000;
              width: 430px;text-align: center;"
            >请先选择网点或承包区才有数据</div>
            <div>
              <el-form-item>
                <el-button @click="onSubmit"><i class="el-icon-upload2" />导出</el-button>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div v-if="id==='2'" class="title1">
          <el-form ref="form" style="display: flex;flex-wrap: wrap;margin-top: 24px;justify-content: space-between;" :model="form" label-width="80px">
            <el-form-item style="margin-left: 0;" class="text" label="日期">
              <el-date-picker
                v-model="value"
                type="daterange"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :default-time="['00:00:00', '23:59:59']"
                style="width: 708px"
              />
            </el-form-item>
            <el-form-item class="text" label="网点名称">
              <el-select
                placeholder="请选择"
                style="width: 286px;"
              >
                <el-option
                  v-for="item in cityList"
                  :key="item.id"
                  class="input"
                  :label="item.city"
                  :value="item.city"
                />
              </el-select>
            </el-form-item>
            <el-form-item class="text" label="承包区名">
              <el-select
                placeholder="请选择"
                style="width: 286px;"
              >
                <el-option
                  v-for="item in cityList"
                  :key="item.id"
                  class="input"
                  :label="item.city"
                  :value="item.city"
                />
              </el-select>
            </el-form-item>
            <div>
              <el-form-item>
                <el-button type="primary" @click="onSubmit">查询</el-button>
                <el-button>重置</el-button>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div v-if="id==='2'" class="title1">
          <el-form ref="form" style="display: flex;justify-content: space-between;flex-wrap: wrap;" :model="form" label-width="80px">
            <!-- <div style="display: flex;justify-content: space-around;flex-wrap: wrap;"> -->
            <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 1628px;">
              <el-form-item class="text" label="日期维度">
                <el-select
                  class="input"
                  placeholder="请输入关键字后自动搜索"
                  style="width: 286px;"
                  @change="provinceChange"
                >
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="账单状态">
                <el-select
                  class="input"
                  placeholder="请输入关键字后自动搜索"
                  style="width: 286px;"
                  @change="provinceChange"
                >
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="承包区名">
                <el-select
                  class="input"
                  placeholder="请输入关键字后自动搜索"
                  style="width: 286px;"
                  @change="provinceChange"
                >
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
              <el-form-item class="text" label="业务员名">
                <el-select
                  class="input"
                  placeholder="请输入关键字后自动搜索"
                  style="width: 286px;"
                  @change="provinceChange"
                >
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
            </div>
            <el-form-item>
              <el-button @click="onSubmit"><i class="el-icon-upload2" />导出</el-button>
            </el-form-item>
          </el-form>
        </div>
        <div v-if="id==='2'" class="title1">
          <el-form ref="form" style="display: flex;justify-content: space-between;flex-wrap: wrap;" :model="form" label-width="80px">
            <!-- <div style="display: flex;justify-content: space-around;flex-wrap: wrap;"> -->
            <div style="display: flex;justify-content: space-between;flex-wrap: wrap;width: 785px;">
              <el-form-item class="text" label="证件姓名">
                <el-input v-model="form.name" class="input" placeholder="请输入关键字后自动搜索" />
              </el-form-item>
              <el-form-item class="text" label="科目类型">
                <el-select
                  class="input"
                  placeholder="请输入关键字后自动搜索"
                  style="width: 286px;"
                  @change="provinceChange"
                >
                  <el-option
                    v-for="item in ProvinceList"
                    :key="item.id"
                    :label="item.province"
                    :value="{ pid: item.pid, province: item.province }"
                  />
                </el-select>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <el-table
          v-if="id==='1'"
          :data="tableData"
          border
          max-height="734"
          max-width="100%"
          :header-cell-style="{ background: '#f6f6f6' }"
          style="width: 100%"
        >
          <el-table-column
            prop="date"
            label=""
            width="180"
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点编号"
            align="center"
            width="100"
          />
          <el-table-column
            prop="address"
            label="网点名称"
            align="center"
            width="100"
          />
          <el-table-column
            prop="name"
            label="承包区编码"
            width="100"
            align="center"
          />
          <el-table-column
            prop="address"
            width="100"
            align="center"
            label="承包区"
          />
          <el-table-column
            prop="address"
            width="100"
            label="业务员编码"
            align="center"
          />
          <el-table-column
            prop="address"
            width="100"
            align="center"
            label="业务员名称"
          />
          <el-table-column
            prop="address"
            width="100"
            label="业务日期"
            align="center"
          />
          <el-table-column label="向寄件方收" align="center">
            <el-table-column label="基础派费收费" align="center">
              <el-table-column label="件量" align="center" />
              <el-table-column label="金额" align="center" />
            </el-table-column>
            <el-table-column label="基础派费收费跳转" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
            <el-table-column label="正常派件退费" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
            <el-table-column label="周期性派费收费" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
            <el-table-column label="大货计重收费" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
            <el-table-column label="违规重量罚款" align="center">
              <el-table-column label="件量" align="center" />
              <el-table-column label="金额" align="center" />
            </el-table-column>
            <el-table-column label="车线补贴收费" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
            <el-table-column label="基础派送付费" align="center">
              <el-table-column label="件量" align="center" />
              <el-table-column label="合计金额" align="center" />
              <el-table-column label="基础派费金额" width="130" align="center" />
              <el-table-column label="综合KPI奖励派费金额" width="160" align="center" />
              <el-table-column label="综合KPI奖励派费件量" width="160" align="center" />
            </el-table-column>
            <el-table-column label="考核奖励派费" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
            <el-table-column label="补贴派费付费" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
            <el-table-column label="周期性派费付费" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
            <el-table-column label="大货计重付费" align="center">
              <el-table-column label="金额" width="140" align="center" />
            </el-table-column>
          </el-table-column>
        </el-table>
        <el-table
          v-if="id==='2'"
          :data="tableData"
          border
          max-height="734"
          :header-cell-style="{ background: '#f6f6f6' }"
          style="width: 100%"
        >
          <el-table-column
            prop="date"
            label=""
            width="180"
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点编号"
            align="center"
          />
          <el-table-column
            prop="address"
            label="网点名称"
            align="center"
          />
          <el-table-column
            prop="address"
            align="center"
            label="承包区编号"
          />
          <el-table-column
            prop="address"
            label="承包区名称"
            align="center"
          />
          <el-table-column
            prop="address"
            align="center"
            label="业务员编号"
            sortable
          />
          <el-table-column
            prop="address"
            label="业务员名称"
            align="center"
          />
          <el-table-column
            prop="address"
            label="证件姓名"
            align="center"
          />
          <el-table-column
            prop="address"
            label="业务日期"
            align="center"
          />
          <el-table-column label="派费直达应付" align="center">
            <el-table-column label="签收量" align="center" />
            <el-table-column label="应付量" align="center" />
            <el-table-column label="应付金额" align="center" />
            <el-table-column label="实付件量" align="center" />
            <el-table-column label="实付金额" align="center" />
            <el-table-column label="未付件量" align="center" />
            <el-table-column label="未付金额" align="center" />
          </el-table-column>
          <el-table-column label="送货上门派费直达" align="center">
            <el-table-column label="应付件量" align="center" />
            <el-table-column label="应付金额-合计" width="120" align="center" />
            <el-table-column label="应付金额-首重" width="120" align="center" />
            <el-table-column label="应付金额-续重" width="120" align="center" />
            <el-table-column label="实付件量" align="center" />
            <el-table-column label="实付金额-合计" width="120" align="center" />
            <el-table-column label="实付金额-首重" width="120" align="center" />
            <el-table-column label="实付金额-续重" width="120" align="center" />
            <el-table-column label="未付件量" align="center" />
            <el-table-column label="未付金额" align="center" />
          </el-table-column>
        </el-table>
        <div style="display: flex;justify-content: space-between;margin-top: 51px;">
          <div class="title2">显示2到2，共2记录</div>
          <div class="block" style="display: flex; justify-content: end">
            <el-pagination
              background
              :current-page="currentPage4"
              :page-sizes="[10, 20, 30, 40]"
              :page-size="10"
              layout="prev, pager, next,sizes"
              :total="khTotal"
              prev-text="上一页"
              next-text="下一页"
              @size-change="khHandleSizeChange"
              @current-change="khHandleCurrentChange"
            />
          </div>
        </div>

      </el-col>
    </el-row>
  </div>
</template>

<script>

export default {

  components: {},
  data() {
    return {
      id: '1',
      ProvinceList: [], // 省
      cityList: [], // 市
      value: '',
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      mxForm: {
        destinationProvince: '',
        destinationCity: ''
      },
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    }
  },

  computed: {},

  created() {
    this.getProvince()
  },

  methods: {
    // tab切换
    tab(e) {
      this.id = e.target.id
    }
  }
}

</script>
<style  scoped lang="scss">
.tit{
  display: flex;
  .tex1{
    margin-right: 48px;
    font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
background: #fff;
border: 1px #fff solid;
  }
  .active{
    font-family: Source Han Sans CN;
font-weight: 700;
color: #2087D0;
position: relative;

  }
  .active::before{
    position: absolute;
      content: '';
      width: 110px;
height: 2px;
background: #2087D0;
border-radius: 1px;
      bottom:-21px;
      left: 49%;
      transform: translate(-50%);
  }
}
.head{
  padding: 30px;
}
.title{
  font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
margin-top: 20px;
}
.line{
  height: 1px;
background: #D8D8D8;
border-radius: 1px;
margin-top: 19px;
}
.title1{
  // display: flex;
  // justify-content: space-between;
  .text{
    font-size: 18px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
// margin-left: 52px;
.input{
  width: 286px;
height: 36px;
background: #FFFFFF;
// border: 1px solid #B4B4B4;
border-radius: 4px;
}
.input1{
  width: 708px;
height: 36px;
background: #FFFFFF;
border: 1px solid #B4B4B4;
border-radius: 4px;
}
  }
}
.title2{
  font-size: 18px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
</style>
